1. Field of the Invention
The present invention relates to a start-up processing technology for various programs which are executed in a computer. Particularly, it relates to the art of starting up a program at high speed and reducing the consumption of a memory used by a program when a start-up processing is executed.
2. Description of the Background Art
A multi-task type operating system (or OS) which is typified by Linux, Windows (which are registered trademarks), or the like, is installed in equipment or a computer. In such equipment, a program dynamic-loading system is generally adopted. This is a system in which a dynamic loader will not load the main body of a program, or a shared library, into an execution space and determine an execution address until this program is started up.
In general, the shared library is a program which is used in common from a plurality of programs. As a program is started up, the dynamic loader retrieves a shared library necessary for this program. Then, the dynamic loader reads or calculates information necessary for loading it from each shared library and sets such information. Sequentially, the dynamic loader loads each shared library into an execution space so that it can be executed.
In the above described dynamic-loading system, it is not until a program is started up that a load processing necessary for this program is executed. Therefore, one and the same shared library can be used in common by several programs. Besides, an improvement is given in the versatility or portability of a program or a shared library. On the other hand, every time a program is started up, a load processing is executed for a program and a shared library. This lengthens the time taken to start up a program.
Under this background, in a program start-up processing by such a dynamic-loading system, in order to execute the start-up of a program at a higher speed, a method is disclosed for obtaining an executable program image in which a designated program and a relevant library program can be dynamically linked together (e.g., refer to Japanese Patent Laid-Open No. 7-160483 specification).
Specifically, a linker (i.e., a dynamic loader) checks an image cache when a program is started up. Then, it examines whether a new program and its relevant library program are already linked up and cached because they have been executed before. If no program is in the image cache, next, the dynamic loader checks whether the relevant library program is cached in a partially-linked form. Then, it uses as many relevant library programs as it can search out. Thereby, the executable program and the executable relevant library program (or shared library) saved in a memory or a cache are reused at the next program start-up. This helps shorten the load processing.
However, according to the above described prior art, in order to execute the load processing promptly, a program and a shared library which are already subjected to a symbol-reference address resolution (i.e., a relocation) are stored in another cache. Hence, a memory capacity is separately required to cache the code and data of a program itself.
Furthermore, according to the above described prior art, a program or a shared library is cached so that the execution code of the program's body or the shared library itself can be quickly executed. However, no mention is made of load-state management information on the load of a shared library which should be managed by the dynamic loader.
This load-state management information is, for example, a piece of information used for grasping a load state: which of shared libraries necessary for a program to be now started up has been loaded, which address each shared library is disposed at, where a specific area of each shared library is disposed, or the like. It differs for each program to be started up, and thus, it needs to be managed in a start-up processing.
Therefore, even if a shared library itself is cached as an execution code which can be instantly loaded, the dynamic loader has to execute a processing for creating and managing the above described load-state management information. This raises a disadvantage in that time is required for this processing.
Moreover, different shared libraries are used by each program, and thus, this load-state management information is necessary for each program. This also presents a disadvantage in that a memory is consumed for each program.